import random
import time

from crawler.connection import filter_push_redis, redis_shedana, redis_conn

total_list = [
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-sneakers-athletic-shoes/CK_XARC81wHAAQHiAgMBAhg.zso',
        'category': 'Shoes>>Sneakers & Athletic'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-sandals/CK_XARC51wHAAQHiAgMBAhg.zso',
        'category': 'Shoes>>Sandals'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-clogs-mules/CK_XARC01wHAAQHiAgMBAhg.zso',
        'category': 'Shoes>>Clogs & Mules'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-heels/CK_XARC41wHAAQHiAgMBAhg.zso',
        'category': 'Shoes>>Heels'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-boots/CK_XARCz1wHAAQHgAQHiAgQBAhgc.zso?s=bestForYou%2Fdesc&si=3621467%2C4394232%2C4394269%2C5377613%2C5377615%2C5377775%2C5377776%2C5377831%2C5377833%2C5378047%2C5831974%2C5831975%2C5831976%2C5831977%2C5831995%2C5831996%2C5832084%2C5832087%2C5832090%2C5832091%2C5832142%2C5832143&sy=1',
        'category': 'Shoes>>Boots & Booties'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-slippers/CK_XARC71wHAAQHiAgMBAhg.zso',
        'category': 'Shoes>>Slippers'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-flats/CK_XARC11wHAAQHiAgMBAhg.zso',
        'category': 'Shoes>>Flats'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-loafers/CK_XARC21wHAAQHiAgMBAhg.zso',
        'category': 'Shoes>>Loafers'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-shoes/CK_XAToCthPAAQHiAgMBGAc.zso',
        'category': 'Shoes>>Comfort'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/filters/women-shoes/CK_XAXoS2QTZBNkE2QTZBNkE2QTZBNkEggEVjBiNGI4YjxiQGIoY3OEDlYAFloAFwAEB4gIDARgP.zso',
        'category': 'Shoes>>Wide'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/filters/women-shoes/CK_XAXoO2QTZBNkE2QTZBNkE2QSCARPJ3AOO2wODGIYYk4AFkoAFkYAFwAEB4gIDARgP.zso',
        'category': 'Shoes>>Narrow'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-shoes/CK_XAToCmSLAAQHiAgMBGAc.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': "Shoes>>Women's Adaptive Shoes"
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-shoes/CK_XAcABAeICAgEY.zso',
        'category': 'Shoes>>Shop All Shoes'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-shirts-tops/CKvXARDL1wHAAQHiAgMBAhg.zso',
        'category': 'Clothing>>Shirts & Tops'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-swimwear/CKvXARDR1wHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Swimwear'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-dresses/CKvXARDE1wHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Dresses'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-skirts/CKvXARDN1wHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Skirts'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-shorts/CKvXARDM1wHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Shorts'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-jeans/CKvXARDI1wHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Jeans & Denim'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-jumpsuits-rompers/CKvXARCN3QHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Jumpsuits & Rompers'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-underwear-intimates/CKvXARDG1wHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Underwear & Intimates'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-sleepwear/CKvXARDJ1wHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Sleepwear'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/filters/activewear-women-clothing/CKvXAcABAeICAgEY.zso?t=activewear&s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Activewear'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-coats-outerwear/CKvXARDH1wHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Coats & Outerwear'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-clothing/CKvXAToCuRPAAQHiAgMBGAc.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Plus Size'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-clothing/CKvXAcABAeICAgEY.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Shop All Clothing'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/c/bags',
        'category': 'Accessories>>Bags & Handbags'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-backpacks/COjWARCQ1wHAAQHiAgMBAhg.zso',
        'category': 'Accessories>>Backpacks'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-lumbar-packs/COjWARCl1wHAAQHiAgMBAhg.zso',
        'category': 'Accessories>>Belt Bags'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-hair-accessories/COfWARCI1wHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Accessories>>Hair'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-sunglasses/CKzXARCq2QHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Accessories>>Sunglasses'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/statement-earrings',
        'category': 'Accessories>>Statement Earrings'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/face-masks',
        'category': 'Accessories>>Face Masks'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/electronics/CKjaAeICAQE.zso?s=isNew%2Fdesc%2FgoLiveDate%2Fdesc%2FrecentSalesStyle%2Fdesc%2F',
        'category': 'Accessories>>Tech Accessories'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-scarves/COfWARCK1wHAAQHiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Accessories>>Scarves'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/women-hats/COfWARCJ1wHAAQHiAgMBAhg.zso?s=bestForYou/desc',
        'category': 'Accessories>>Hats'
    },
    {
        'sex': 'women',
        'url': 'https://www.zappos.com/c/jewelry-accessories',
        'category': 'Accessories>>Shop All Accessories'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-sneakers-athletic-shoes/CK_XARC81wHAAQLiAgMBAhg.zso?s=bestForYou%2Fdesc&si=5589155&sy=1',
        'category': 'Shoes>>Sneakers & Athletic'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-sandals/CK_XARC51wHAAQLiAgMBAhg.zso?s=bestForYou/desc',
        'category': 'Shoes>>Sandals'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-running-shoes/CK_XARC81wEY0O4BwAEC4gIEAQIDGA.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Shoes>>Running Shoes'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-oxfords/CK_XARC31wHAAQLiAgMBAhg.zso?s=bestForYou%2Fdesc',
        'category': 'Shoes>>Oxfords'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-loafers/CK_XARC21wHAAQLiAgMBAhg.zso?s=bestForYou/desc',
        'category': 'Shoes>>Loafers'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-clogs/CK_XARC01wHAAQLiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Shoes>>Clogs'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-boots/CK_XARCz1wHAAQLgAQHiAgQBAhgc.zso?s=bestForYou%2Fdesc&si=5370348%2C5370351%2C5370727%2C5816018%2C5816019%2C5816031%2C5816032%2C5817595%2C5817596%2C5817599&sy=1',
        'category': 'Shoes>>Boots'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/mens-wide-shoes',
        'category': 'Shoes>>Wide'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-shoes/CK_XAToCmSLAAQLiAgMBGAc.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': "Shoes>>Men's Adaptive Shoes"
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-shoes/CK_XAcABAuICAgEY.zso',
        'category': 'Shoes>>Shop All Shoes'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-shirts-tops/CKvXARDL1wHAAQLiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Shirts & Tops'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-shorts/CKvXARDM1wHAAQLiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Shorts'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-swimwear/CKvXARDR1wHAAQLiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Swimwear'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-pants/CKvXARDK1wHAAQLiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Pants'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-jeans/CKvXARDI1wHAAQLiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Jeans'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-underwear/CKvXARDT1wHAAQLiAgMBAhg.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Underwear'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/filters/activewear-men-clothing/CKvXAcABAuICAgEY.zso?t=activewear&s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Activewear'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/filters/men-clothing/CKvXAToEmw2dDcABAuICAwEYBw.zso?s=isNew/desc/goLiveDate/desc/recentSalesStyle/desc/',
        'category': 'Clothing>>Office & Career'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-clothing/CKvXAToCuxPAAQLiAgMBGAc.zso',
        'category': 'Clothing>>Big and Tall'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-clothing/CKvXAcABAuICAgEY.zso',
        'category': 'Clothing>>Shop All Clothing'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-bags/COjWAcABAuICAgEY.zso',
        'category': 'Accessories>>Bags'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-hats/COfWARCJ1wHAAQLiAgMBAhg.zso',
        'category': 'Accessories>>Hats'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-eyewear/CKzXAcABAuICAgEY.zso',
        'category': 'Accessories>>Sunglasses & Eyewear'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-belts/COfWARCG1wHAAQLiAgMBAhg.zso',
        'category': 'Accessories>>Belts'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-watches/CLHXAcABAuICAgEY.zso',
        'category': 'Accessories>>Watches'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/mens-gloves',
        'category': 'Accessories>>Gloves'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/electronics/CKjaAeICAQE.zso?s=isNew%2Fdesc%2FgoLiveDate%2Fdesc%2FrecentSalesStyle%2Fdesc%2F',
        'category': 'Accessories>>Tech Accessories'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-wallets/COjWARCW1wHAAQLiAgMBAhg.zso',
        'category': 'Accessories>>Wallets'
    },
    {
        'sex': 'men',
        'url': 'https://www.zappos.com/men-accessories/COfWAcABAuICAgEY.zso',
        'category': 'Accessories>>Shop All Accessories'
    }
]

for index, total in enumerate(total_list):
    task = {
        "jobId": index,
        'url': total['url'],
        'category': total['category'],
        'sex': total['sex'],
        'domain': 'ZAPPOS'.upper(),
        'filename': 'main',
        'types': 'electronic_business',
        "scheduleTime": int(time.time() * 1000),
        "triggerChannel": 'SONIC_SPIDER',
    }

    result = filter_push_redis(redis_conn,
                               f'{task["types"]}_{task["filename"]}_{task["domain"]}',
                               task)
    # result = filter_push_redis(redis_shedana,
    #                            f'{task["types"]}_{task["filename"]}_{task["domain"]}',
    #                            task)
    # # result = filter_push_redis(redis_shedana,
    # #                            f'{task["types"]}_{task["filename"]}_{task["domain"]}',
    # #                            task)
    # print(result)
    # # input()

